﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BO_Actions.BO_AdminUsers;
using Entity.StoreProcedure;
using BusinessObjects;

namespace BusinessObjects.BO_GetObjects
{
    public class BO_AdminUsers
    {
        public static bool IsInRole(string username, string modulename)
        {
            try
            {
                BOIsInRole action = new BOIsInRole();
                usp_IsInRole entity = new usp_IsInRole();
                entity.USER_NAME = username;
                entity.MODULE_NAME = modulename;
                string a = (action.ExecuteAndReturnDataTable(entity).Rows[0][0]).ToString();
                if (action.ExecuteAndReturnStringValue(entity).Equals("1"))
                    return true;
                else
                    return false;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
